export default {
    Base: {
        Title: '表单功能测试',
        Type: '000001',
    },
    Param: [
        { Key: 'id', Label: '主键', Type: 'Primary' },
        { Key: 'name', Label: '名称', Type: 'String', Default: '默认名称', },
        {
            Key: 'longitude', Label: '经度', Type: 'String', Unit: '°', step: 1, max: 100, min: 10, precision: 0, readonly: true,
        },
        {
            Key: 'latitude', Label: '纬度', Type: 'Number', Unit: '°', readonly: true,
            // Rule: { required: true, Description: 'ASD', Error: 'ASD' },
        },
        {
            Key: 'height', Label: '高度', Type: 'Int', Unit: 'm',
            Rule: { required: true, Description: '一大堆测试消息', Error: '这是一个错误消息', RegExp: '^\\d+$' },
        },
        {
            Key: 'state', Label: '状态', Type: 'Radio', Default: 0,
            Dict: [{ value: 0, label: '状态1' }, { value: 1, label: '状态2' }, { value: 2, label: '状态3' }]
        },
        {
            Key: 'TestKey1', Label: '测试数据1', Type: 'String', Default: 'A',
            Event: { Enable: 'state == 0' },
        },
        {
            Key: 'TestKey2', Label: '测试数据2', Type: 'String', Default: 'A',
            Event: { Enable: 'state == 0' },
        },
        {
            Key: 'TestKey3', Label: '测试数据3', Type: 'String', Default: 'B',
            Event: { Enable: 'state == 1' },
        },
        {
            Key: 'TestKey4', Label: '测试数据4', Type: 'String', Default: 'B',
            Event: { Enable: 'state == 1' },
        },
        {
            Key: 'TestKey5', Label: '测试数据5', Type: 'Number', Default: 1,
            Event: {
                // Value: { 'state == 0': 'A', 'state == 1': 'B', 'state == 2': 'C' },
                Wacth: { state: 'state + 1' },
            }
        },
        { Key: 'Tree', Label: '第一级联动', Type: 'Select', Default: 1, Dict: 'Tree' },
        { Key: 'TreeChild', Label: '第二级联动', Type: 'Select', Dict: 'Tree:children:null', },
        { Key: 'TreeChildChild', Label: '第三级联动', Type: 'Select', Dict: 'TreeChild:children:0', },
        { Key: 'child', Label: '对象联动', Type: 'Model:000002' },
        // Dictionary
        {
            Key: 'List', Label: '测试数组', Type: 'Array:String', Default: [], ItemOption: {
                Label: '"第" + index + "组 : "', LabelStyle: { width: '70px' }, ViewType: 'Default', Rule: { required: true, Description: '', Error: '' },
            }
        },
        {
            Key: 'TestDict', Label: '测试字典', Type: 'Dictionary:String', Default: {}, Option: {
                LabelStyle: { width: '70px' }, ViewType: 'Default', Rule: { required: true, Description: '', Error: '' },
            }
        },


        { Key: 'CheckBox', Label: '测试多选', Type: 'CheckBox', Default: false },

    ],

    // 预定 的 表单元素自定义模板渲染结构
    // var data = {
    //     Template: '',
    //     Key: '',
    //     RenderType: '',
    //     Option: {},
    //     isFormItem: true
    // }

    View: {
        Default: {
            type: 'Layout.DefaultLayout',
            options: { labelCol: { style: { width: '100px' } } },
            slots: {
                default: [{
                    type: 'Layout.FormGroup', options: { title: '地理信息', }, slots: { default: ['longitude', 'latitude', 'height'] }
                }, {
                    type: 'Layout.FormGroup', options: { title: '模型参数', }, slots: { default: ['ReadOnly:name', 'state', 'CheckBox'] }
                }, {
                    type: 'Layout.FormGroup', options: { title: '状态联动', }, slots: { default: ['TestKey1', 'TestKey2', 'TestKey3', 'TestKey4'] }
                }, {
                    type: 'Layout.FormGroup', options: { title: '数据联动', }, slots: { default: ['TestKey5'] }
                }, {
                    type: 'Layout.FormGroup', options: { title: '三级联动', }, slots: { default: ['Tree', 'TreeChild', 'TreeChildChild'] }
                }, {
                    type: 'Layout.FormGroup', options: { title: '子集联动', }, slots: { default: ['Default:child'] }
                }, {
                    type: 'Layout.FormGroup', options: { title: '测试数组链接', }, slots: { default: ['ArrayList:List'] }
                }, {
                    type: 'Layout.FormGroup', options: { title: '测试数组链接', }, slots: { default: ['Default:TestDict'] }
                }],
            },
        },
        Test: {
            type: 'Layout.DefaultLayout',
            options: { labelCol: { style: { width: '100px' } } },
            slots: {
                default: [{
                    type: 'Layout.FormGroup', options: { title: '地理信息', }, slots: { default: ['longitude', 'latitude', 'height'] }
                }, {
                    type: 'Layout.FormGroup', options: { title: '模型参数', }, slots: { default: ['ReadOnly:name', 'state'] }
                }, {
                    type: 'Layout.FormGroup', options: { title: '经纬度', }, slots: {
                        default: [
                            'longitude', 'latitude',
                            {
                                type: 'Layout.Position', options: { Label: '经纬度', Keys: ['longitude', 'latitude'] }
                            }
                        ]
                    }
                }]
            }
        },
        cols: {
            type: 'Layout.DefaultLayout',
            options: { labelCol: { style: { width: '100px' } } },
            slots: {
                default: [{
                    type: 'Layout.RowGroup', options: { ColArray: [16, 8], RowGutter: 16 }, slots: {
                        Col_0: ['longitude'],
                        Col_1: ['latitude'],
                    }
                }]
            }
        },
        Dialog: {
            ShowParentValueKey: 'name',
            width: 700,
            height: 'auto',
        },
        Table: {
            cols: [
                { title: '名称', dataIndex: 'name', key: 'name', },
                { title: '状态', dataIndex: 'state', key: 'state', },
                { title: '操作', key: 'action', Events: ['Editor', 'delete'] },
            ]
        }
    },
}

